package com.zhongwang.mms.module.material.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * @Description: 出入库综合查询
 * @Author: China.zy
 * @Date: 2020/3/21
 */
@Data
public class CompositeOutcomeModel {

    @ExcelIgnore
    private Integer odrId;
    @ExcelIgnore
    private Integer odaId;
    /**
     * 临时表名
     */
    @Resource
    private String tempTableName;
    /**
     * 出入库类别 1入库 2出库
     */
    @ExcelIgnore
    private Integer inOutType;

    /**
     * 单据类型 1采购入库 2退料入库 4领料出库
     */
    @ExcelIgnore
    private Integer odrType;

    /**
     * 单据类型描述 1采购入库 2退料入库 4领料出库
     */
    @ExcelProperty(value = "单据类型",index = 0)
    private String odrTypeName;

    /**
     * 单据编号
     */
    @ExcelIgnore
    private String odrCode;

    /**
     * 类型
     */
    @ExcelProperty(value = "类型",index = 2)
    private String matTypeName;

    /**
     * 材质
     */
    @ExcelProperty(value = "材质",index = 3)
    private String matQualityName;

    /**
     * 规格
     */
    @ExcelProperty(value = "规格",index = 4)
    private String matSpecName;

    /**
     * 宽度
     */
    @ExcelProperty(value = "宽度",index = 5)
    private Double matWidth;

    /**
     * 长度
     */
    @ExcelProperty(value = "长度",index = 6)
    private Double matLength;

    /**
     * 米重/厚度
     */
    @ExcelProperty(value = "米重/厚度",index = 7)
    private Double matHeight;

    /**
     * 数量
     */
    @ExcelProperty(value = "数量",index = 8)
    private Double odaNum;

    /**
     * 理论重量
     */
    @ExcelProperty(value = "理论重量",index = 10)
    private Double odaWeight;

    /**
     * 单价
     */
    @ExcelProperty(value = "单价（元）",index = 11)
    private Double odaPrice;

    /**
     * 金额
     */
    @ExcelProperty(value = "金额（元）",index = 12)
    private Double odaAmount;

    /**
     * 跟踪号
     */
    @ExcelProperty(value = "跟踪号",index = 13)
    private String odaTrackCode;

    /**
     * 项目编码
     */
    @ExcelProperty(value = "项目编码",index = 14)
    private String odaProCode;

    /**
     * 项目名称
     */
    @ExcelProperty(value = "项目名称",index = 15)
    private String odaProName;

    /**
     * 特殊说明
     */
    @ExcelProperty(value = "特殊说明",index = 16)
    private String odaSpec;

    /**
     * 制单日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date odrMakeDate;

    /**
     * 起始制单日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startOdrMakeDate;

    /**
     * 结束制单日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endOdrMakeDate;

    /**
     * 出入库日期
     */
    @ExcelProperty(value = "出入库日期",index = 17)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date odrDate;

    /**
     * 起始出入库日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startOdrDate;

    /**
     * 结束出入库日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endOdrDate;

    public void setEndOdrDate(Date endOdrDate) {
        if (endOdrDate != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endOdrDate);
            cal.add(Calendar.DAY_OF_YEAR, +1);
            this.endOdrDate = cal.getTime();
        } else {
            this.endOdrDate = endOdrDate;
        }
    }

    /**
     * 使用部门
     */
    @ExcelProperty(value = "部门",index = 18)
    private String odrTakeWorkshop;

    /**
     * 制单人
     */
    @ExcelProperty(value = "制单人",index = 19)
    private String odrMakePerson;

    /**
     * 经手人/领料人
     */
    @ExcelIgnore
    private String odrTakePerson;


    /**
     * 原料分类
     */
    @ExcelIgnore
    private String materialKind;

    /**
     * 单据明细类型：1：蓝单 2：红单
     */
    @ExcelIgnore
    private Integer odaItyFlag;

    /**
     * 是否红字显示： 1否 2是
     */
    @ExcelIgnore
    private Integer odaRedFlag;

    /**
     * 在库类型 1库存在库 2项目在库
     */
    @ExcelIgnore
    private Integer odaInType;

    /**
     * 回货日期
     */
    @ExcelIgnore
    private String odaBackDate;

    /**
     * 原料描述
     */
    @ExcelIgnore
    private String matNameDesc;

    /**
     * 主单备注(导出Excel专用)
     */
    @ExcelProperty(value = "单据摘要",index = 20)
    private String odrRemarkPrint;

    @ExcelProperty(value = "SAP物料编码",index = 1)
    private String odaMatSapCode;

    @ExcelProperty(value = "在库类型",index = 15)
    private String odaInTypeName;

    @ExcelProperty(value = "库位",index = 21)
    private String odrWhiName;
    @ExcelProperty(value = "区位",index = 22)
    private String odaPosition;

    @ExcelIgnore
    private Integer odrWhiId;

    @ExcelIgnore
    private String whiIdQueryList;

    @ExcelIgnore
    private List<String> whiIdList;

    @ExcelProperty(value = "领料长度(米)",index = 9)
    private Double pkMatLength;
    private  String contractNo;//合同编号
    private  String supplier;//供应商

}
